<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddSnAndMerchantIdToStoreDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('store_details', function (Blueprint $table) {
            if(!Schema::hasColumns('store_details', ['merchant_id', 'sn']))
            {
            	$table->string('merchant_id', 50)->nullable()->comment('分店分账账号');
            	$table->string('sn', 50)->nullable()->comment('分店充值虚拟设备号');
            }
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('store_details', function (Blueprint $table) {
            //
        });
    }
}
